package dtos;

import java.io.Serializable;
import java.util.ArrayList;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
 * Generic DTO class.
 */
public class GenericDTO implements Serializable {

    private long id;

    private static final long serialVersionUID = 1L;

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 31).toHashCode();
    }

    @Override
    public boolean equals(final Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        if (obj.getClass() != this.getClass()) {
            return false;
        }

        GenericDTO rhs = (GenericDTO) obj;
        return EqualsBuilder.reflectionEquals(this, rhs, new ArrayList<String>().add("id"));
    }

    public void setId(final long id) {
        this.id = id;
    }

    public long getId() {
        return this.id;
    }
}
